﻿package net.wangit.dev.wizard.element;

import net.wangit.jdbc.ColumnRow;
import net.wangit.jdbc.DB;
import net.wangit.jdbc.Table;
import net.wangit.util.StringUtil;

public class AEUnit {

	public AEUnit() {
	}

	public static final void create(DB db, String father, String son,
			int order, boolean makeBottomPadding) throws Exception {
		Table table = new Table("dev", "ELEMENT");
		ColumnRow cRow = table.addInsertRow();
		cRow.set("uid", father);
		cRow.set("eid", StringUtil.replace(son, ".", "_"));
		cRow.set("c", 80);
		cRow.set("r", son);
		cRow.set("o", order);
		cRow.set("al", 0);
		if (makeBottomPadding)
			cRow.set("wpb", 2);
		cRow.set("a", "0");
		cRow.set("au", 0);
		cRow.set("s", 1);
		db.save(table);
	}
}
